
import fetchJson from './fetchJson'
import tools from './tools'
import Config from './config'
import eventBus from '../eventBus'
export default {
  start () {
    this.getFiberList()
  },

  getFiberList (id) {
    eventBus.bus.$emit('showLoading')
    fetchJson.getJson({
      self: this,
      url: '/cable/show/?id=' + id,
      callback: this.callback,
      error: this.error
    })
  },

  callback (json) {
    eventBus.bus.$emit('hideLoading')
    if (json.code === 1) {
      eventBus.bus.$emit('showPointList', json.data)
    } else {
      eventBus.bus.$message({
        message: json.message,
        type: 'warning'
      })
    }
  },

  error () {
    eventBus.bus.$emit('hideLoading')
  }
  
}
